<div class="container">
  <h1>form_input()</h1>
  <p class="signature">function form_input(string $name, ?string $value = null, ?array $attributes = null): string</p>
  <h2>Description</h2>
  <div class="description">
    <p>Generates a text input form field element.</p>
  </div>
  <h2>Parameters</h2>
  <table>
    <thead>
      <tr>
        <th>Parameter</th>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>$name</td>
        <td>string</td>
        <td>The name attribute for the input element.</td>
      </tr>
      <tr>
        <td>$value</td>
        <td>string|null</td>
        <td>(optional) The value attribute for the input element. Default is null.</td>
      </tr>
      <tr>
        <td>$attributes</td>
        <td>array|null</td>
        <td>(optional) Additional attributes for the input element as an associative array. Default is null.</td>
      </tr>
    </tbody>
  </table>
  <h2>Return Value</h2>
  <table>
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>string</td>
        <td>The generated HTML input element.</td>
      </tr>
    </tbody>
  </table>
  <h2>Example #1</h2>
  <p>The code sample below demonstrates the basic usage of the <code>form_input</code> function with default parameters.</p>
  <pre>
$name = 'username';
$value = 'john_doe';
echo form_input($name, $value);
// Output: '&lt;input type="text" name="username" value="john_doe"&gt;'
  </pre>
  <h2>Example #2</h2>
  <p>The code sample below demonstrates a more complex usage of the <code>form_input</code> function with additional attributes.</p>
  <pre>
$name = 'username';
$value = 'john_doe';
$attributes = ['class' => 'form-control', 'id' => 'username-input', 'placeholder' => 'Enter your username'];
echo form_input($name, $value, $attributes);
// Output: '&lt;input type="text" name="username" value="john_doe" class="form-control" id="username-input" placeholder="Enter your username"&gt;'
  </pre>
</div>